package com.zztl.infiniteBand.net.imp

import com.zztl.infiniteBand.model.*
import okhttp3.MultipartBody
import okhttp3.RequestBody
import okhttp3.ResponseBody
import retrofit2.http.*
import rx.Observable

/**
 * @desc
 * @auth ${user}
 * @time 2018/6/4  11:51
 */
interface Api {
    @POST("user/login")
    fun login(@Body loginRequest: String): Observable<LoginBean>

    @POST("user/register")
    fun register(@Body registerRequest: String): Observable<NoDataResponseBean>

    @POST("sms/sendMessage")
    fun getCode(@Body registerRequest: String): Observable<GetVerifyBean>

    @POST("user/password/upd")
    fun amendPwd(@Body amendPwdRequeet: String): Observable<NoDataResponseBean>

    @POST("equipment/list")
    fun getDeviceList(@Body getDeviceRequeet: String): Observable<DeviceBean>

    @POST("equipment/list")
    fun updateDeviceList(@Body updateDeviceRequeet: String): Observable<DeviceBean>

    @POST("equipment/unbind")
    fun unBindDevice(@Body unbindDeviceRequset: String): Observable<NoDataResponseBean>

    @POST("user/AssetManagement")
    fun getAssets(@Body assets: String): Observable<UserAssetsBean>

    @POST("user/info")
    fun getInfo(@Body info: String): Observable<PersonInfoBean>

    @POST("message/notice/statistics")
    fun getNotification(@Body notice: String): Observable<NoticeCountBean>

    @POST("wallet/validate/address")   //校验钱包地址
    fun checkAddress(@Body address: String): Observable<CheckAddressBean>

    @POST("platform/info")   //平台信息
    fun getPlatform(@Body platformName: String): Observable<PlatformBean>

    @POST("wallet/out")   //转出
    fun payout(@Body payoutRequest: String): Observable<TransferBean>

    @POST("wallet/get/address")   //获取钱包地址
    fun getWalletAddress(@Body getAddrRequest: String): Observable<AddressBean>

    @POST("user/setInfo")   //设置个人信息
    fun setPersonInfo(@Body setPersonInfo: String): Observable<NoDataResponseBean>

    @POST("Transaction/record")   //转出入记录
    fun getTransactionRecord(@Body record: String): Observable<TradingRecordBean>

    @POST("Transaction/record/details")   //转出入详情
    fun getTransactionRecordDetail(@Body recordDetail: String): Observable<TradingDetailBean>

    @POST("message/type/list")   //消息列表
    fun getMessage(@Body msgRequest: String): Observable<MsgBean>


    @POST("message/notice/statistics")   //消息通知数量
    fun getMessageNoticeCount(@Body msgCountRequest: String): Observable<NoticeCountBean>

    @POST("message/notice/list")   ////指定消息类型列表
    fun getServiceMessageList(@Body msgList: String): Observable<ServiceNoticeBean>

    @POST("message/notice/list")   ////指定消息类型列表
    fun getCompanyOrSysMessageList(@Body msgList: String): Observable<SysOrCompanyBean>

    @POST("user/setRealInfo")   //提交实名认证信息
    fun certificate(@Body certificateRequest: String): Observable<NoDataResponseBean>

    @POST("user/realInfo")   //实名认证信息
    fun getCertificateInfo(@Body certificateRequest: String): Observable<AuditStatusBean>

    @POST("equipment/binding")   //实名认证信息
    fun bindDevice(@Body bindDeviceRequest: String): Observable<NoDataResponseBean>

    @POST("equipment/mining/details")   //设备
    fun miningDetail(@Body miningRequest: String): Observable<MiningBean>


    @POST("equipment/reward/receive")   //奖励领取
    fun miningReceive(@Body receiveRequest: String): Observable<NoDataResponseBean>


    /**
     * 是否内平台地址
     * @param checkPlatformAddr
     * @return
     */
    @POST("wallet/validate/isInner")
    fun checkPlatformAddress(@Body checkPlatformAddr: String): Observable<CheckAddressBean>


    @POST("user/rebindingPhone")
    fun changePhone(@Body changePhoneData: String): Observable<NoDataResponseBean>

    @POST("sms/valid")
    fun identityVerify(@Body verifyData: String): Observable<NoDataResponseBean>


    @POST("user/resetTPwd")
    fun setPayPwd(@Body pwd: String): Observable<NoDataResponseBean>


    @POST("sys/contactInfo")
    fun getContactInfo(@Body data: String): Observable<ContactInfoBean>

    @POST("user/incomeRanking")
    fun getRankingList(@Body rankingRequest: String): Observable<RanklistBean>


    @POST("activity/incomeList")
    fun getInviteIncome(@Body inviteIncomeRequest: String): Observable<InviteIncomeBean>

    @POST("equipment/upd/mileage_sum")
    fun syncStep(@Body syncStep: String): Observable<NoDataResponseBean>


    @POST("wallet/get/address/history")
    fun getAddressList(@Body data: String): Observable<AddressListBean>

    @POST("equipment/binding/list")
    fun getBindDeviceList(@Body data: String): Observable<BindedDeviceBean>


    @POST("equipment/type/detail")
    fun getTargetStep(@Body data: String): Observable<TargetStepBean>


    @POST("activity/getParams")
    fun getInviteParams(@Body data: String): Observable<InviteBean>


    @POST("activity/getDetailUrl ")
    fun getInviteDetail(@Body data: String): Observable<InviteDetailBean>





    /**
     * 发现页
     * @param data
     * @return
     */
    @POST("message/notice/home")
    fun getFindData(@Body data: String): Observable<FindBean>

    /**
     * 上传血压值
     */
    @POST("blood_pressure/add")
    fun uploadBloodPressure(@Body data: String): Observable<NoDataResponseBean>


    /**
     * 获取原力值
     */
    @POST("blood_pressure/getForceValue")
    fun getForceVlue(@Body data: String): Observable<ForceValueBean>




    /**
     * 上传里程和总消耗
     */
    @POST("healthData/add")
    fun uploadHealthData(@Body data: String): Observable<NoDataResponseBean>

    /**
     * 获取版本号
     */
    @POST("version")
    fun getVersion(@Body data: String): Observable<VersionResponseBean>


    /**
     * 获取固件版本号
     * @param data
     * @return
     */
    @POST("firmware/version")
    abstract fun getFirmwareVersion(@Body data: String): Observable<FirmwareVersionBean>

    @Multipart
    @POST("user/photo")
    fun uploadImage(@Part part: MultipartBody.Part, @Part(RequestKeys.FTILETYPE) type: RequestBody): Observable<UploadFileBean>





    /**
     * 下载文件
     */
    @Streaming
    @GET
    fun loadFile(@Url url: String): Observable<ResponseBody>

}
